#pragma once

//#define H264_OLD_DEC

#ifdef H264_OLD_DEC
#include "avcdecoder.h"
#else
#include "H264_dec.h"
#endif
#include "TG_DecSDK.h"

//#ifdef _DEBUG
//#define dkq_decdk_test
//#endif
#ifdef dkq_decdk_test
#define dkq_test_video_decode
#include "..\TGPublic\TGLogInfo.h"
#endif

//#define dkq_write_264

#ifdef dkq_write_264
#include "stdio.h"
#endif

class TGVideoDecMan
{
public: 
	TGVideoDecMan(void);
	~TGVideoDecMan(void);

public:
	int Decode(BYTE* pEncFrame,long lEncSize,TG_VIDEO_DEC_INFO *pOutDecInfo);

#ifdef H264_OLD_DEC
private:
	avcdDecoder_t *m_pAvcDec;

private:
	unsigned long   m_lEncFrameIndex;
	avcdYUVbuffer_s m_avcDecBufTab[2];

private:
	unsigned long  m_lDecBufSize;
	unsigned char *m_pDecBuffer; 
#else
private:
	void *m_pAvcDec;
#endif

private:
	unsigned short m_nVideoWidth;
	unsigned short m_nVideoHeight;

#ifdef dkq_decdk_test
public:
	TGLogInfo m_xLog;
#endif

#ifdef dkq_write_264
	FILE *m_h264;
	FILE *m_h264log;
#endif
};
